<template>
  <div>
    <div class="title">国内疫情地图</div>
    <van-tabs v-model="active" animated>
      <van-tab title="现有确诊" >
        <div id="main" style="width: 100%; height: 700px"></div>
       </van-tab>


    </van-tabs>

  </div>
</template>

<script>
import "vant/lib/index.css";

export default {
  data() {
    return {
      active: 0,
      list:[]
    };
  },
  created(){
    this.getInformation();
  },

  methods: {
    getInformation(){
      this.$jsonp(
        'https://interface.sina.cn/news/wap/fymap2020_data.d.json'
        )
          .then((res) => {
            // console.log(res)
            let Arr1 = [];

            res.data.list.forEach(item=>{
                let nowObj={}
                nowObj.name = item.name;
                nowObj.value = item.econNum;
                Arr1.push(nowObj)

            })
            // console.log(Arr1);

            this.$myChart.chinaMap("main",Arr1);
            // this.$myChart.chinaMap("cur",Arr2);
          })
          .catch((err) => {
            console.log(err)
          })
  },
  }
};
</script>

<style lang="less" scoped>
.title {
  border-left: 10px solid rgb(6, 6, 231);
  padding-left: 5px;
  color: #666;
  font-size: x-large;
  font-weight: 900;
}

</style>
